/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author root
 */
@Entity
@Table(name = "articulos")
@NamedQueries({
    @NamedQuery(name = "Articulos.findAll", query = "SELECT a FROM Articulos a"),
    @NamedQuery(name = "Articulos.findByIdArticulo", query = "SELECT a FROM Articulos a WHERE a.idArticulo = :idArticulo"),
    @NamedQuery(name = "Articulos.findByTipoArticulo", query = "SELECT a FROM Articulos a WHERE a.tipoArticulo = :tipoArticulo"),
    @NamedQuery(name = "Articulos.findByMarca", query = "SELECT a FROM Articulos a WHERE a.marca = :marca"),
    @NamedQuery(name = "Articulos.findByNumeroSerie", query = "SELECT a FROM Articulos a WHERE a.numeroSerie = :numeroSerie"),
    @NamedQuery(name = "Articulos.findByMarcaNumeroSerie", query = "SELECT a FROM Articulos a WHERE a.numeroSerie = :numeroSerie AND a.marca = :marca"),
    @NamedQuery(name = "Articulos.findByColor", query = "SELECT a FROM Articulos a WHERE a.color = :color"),
    @NamedQuery(name = "Articulos.findByUnidadAlojamiento", query = "SELECT a FROM Articulos a WHERE (a.ubicacionFisica = :idUnidadAlojamiento)"),
    @NamedQuery(name = "Articulos.findByDescripcion", query = "SELECT a FROM Articulos a WHERE a.descripcion = :descripcion")})
public class Articulos implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idArticulo")
    private Integer idArticulo;
    @Basic(optional = false)
    @Column(name = "tipo_articulo")
    private String tipoArticulo;
    @Basic(optional = false)
    @Column(name = "marca")
    private String marca;
    @Basic(optional = false)
    @Column(name = "numero_serie")
    private String numeroSerie;
    @Basic(optional = false)
    @Column(name = "color")
    private String color;
    @Basic(optional = false)
    @Column(name = "descripcion")
    private String descripcion;
    @JoinColumn(name = "ubicacion_fisica", referencedColumnName = "idUnidad")
    @ManyToOne(optional = false)
    private UnidadesAlojamiento ubicacionFisica;

    public Articulos() {
    }

    public Articulos(Integer idArticulo) {
        this.idArticulo = idArticulo;
    }

    public Articulos(Integer idArticulo, String tipoArticulo, String marca, String numeroSerie, String color, String descripcion) {
        this.idArticulo = idArticulo;
        this.tipoArticulo = tipoArticulo;
        this.marca = marca;
        this.numeroSerie = numeroSerie;
        this.color = color;
        this.descripcion = descripcion;
    }

    public Integer getIdArticulo() {
        return idArticulo;
    }

    public void setIdArticulo(Integer idArticulo) {
        this.idArticulo = idArticulo;
    }

    public String getTipoArticulo() {
        return tipoArticulo;
    }

    public void setTipoArticulo(String tipoArticulo) {
        this.tipoArticulo = tipoArticulo;
    }

    public String getMarca() {
        return marca;
    }

    public void setMarca(String marca) {
        this.marca = marca;
    }

    public String getNumeroSerie() {
        return numeroSerie;
    }

    public void setNumeroSerie(String numeroSerie) {
        this.numeroSerie = numeroSerie;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public UnidadesAlojamiento getUbicacionFisica() {
        return ubicacionFisica;
    }

    public void setUbicacionFisica(UnidadesAlojamiento ubicacionFisica) {
        this.ubicacionFisica = ubicacionFisica;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idArticulo != null ? idArticulo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Articulos)) {
            return false;
        }
        Articulos other = (Articulos) object;
        if ((this.idArticulo == null && other.idArticulo != null) || (this.idArticulo != null && !this.idArticulo.equals(other.idArticulo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Articulos[ idArticulo=" + idArticulo + " ]";
    }
}
